package com.yc.myspringboot.service.impl.factory1;

import com.yc.myspringboot.service.factory1.Ite1;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created with IntelliJ IDEA.
 * description:
 * author: yc
 * date: 2021/5/7 15:23
 */
@Service
public class Ite1Factory {
    @Resource
    private Map<String, Ite1> ite1Map = new ConcurrentHashMap<>();

    public Ite1 getInstance(String name) {
        Ite1 instance = ite1Map.get(name);
        if (instance == null) {
            System.out.println("No ServiceImpl "+ name);
        }
        return instance;
    }
}
